home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / jpi / miscfunc.bas < prev    next >
BASIC Source File  |  1998-01-08  |  1KB  |  45 lines

  1. Attribute VB_Name = "MiscFunctions"
  2. Public Function ConvertTrueFalse(VarBlE) As Boolean
  3. If VarBlE = "True" Then ConvertTrueFalse = True Else ConvertTrueFalse = False
  4. End Function
  5. Public Function GetCommandLineArg(ArguementString$) As String
  6. GamePlace = InStr(1, LCase$(Command$), ArguementString$)
  7. If GamePlace > 0 Then
  8.   BeginSpacePlace = InStr(GamePlace + 5, Command$, " ")
  9.   EndSpacePlace = InStr(BeginSpacePlace + 1, Command$, " ")
  10.   If EndSpacePlace = 0 Then EndSpacePlace = Len(Command$) + 1
  11.   GetCommandLineArg = Mid$(Command$, BeginSpacePlace, EndSpacePlace - BeginSpacePlace)
  12. Else
  13.   GetCommandLineArg = "NULL"
  14. End If
  15. End Function
  16. Public Function GetPropertyValue(TextString) As String
  17. GetPropertyValue = Right$(TextString, Len(TextString) - InStr(1, TextString, " "))
  18. End Function
  19. Public Function GetPropertyName(TextString) As String
  20. If InStr(1, TextString, " ") = 0 Then
  21.   GetPropertyName = TextString
  22. Else
  23.   GetPropertyName = Left$(TextString, InStr(1, TextString, " ") - 1)
  24. End If
  25. End Function
  26. Public Function RemoveSpaces(Txt)
  27. NewTxt = Txt
  28. Do
  29.   If Left$(NewTxt, 1) = " " Then
  30.     NewTxt = Right$(NewTxt, Len(NewTxt) - 1)
  31.   Else
  32.     Exit Do
  33.   End If
  34. Loop
  35. RemoveSpaces = NewTxt
  36. End Function
  37.  
  38. Public Sub Wait(TimeAmount)
  39. EndTime = Timer + TimeAmount
  40. Do
  41.   DoEvents
  42.   If Timer > EndTime Then Exit Do
  43. Loop
  44. End Sub
  45.